/*
 * --------------------------------------------------------------
 * Copyright ©  2015 Hangzhou DtDream Technologies Co.,Ltd.
 * --------------------------------------------------------------
 *      Product: 协同数治
 *  Module Name: design
 * Date Created: 2023/2/2
 *  Description: TODO
 * --------------------------------------------------------------
 * Modification History
 * DATE            NAME            Description
 * --------------------------------------------------------------
 * 2023/2/2       yewj            TODO
 * --------------------------------------------------------------
 */

package com.dtdream.pattern.adapter.objadapter;

/**
 * 类适配器
 *
 * @Author: yewj
 **/
public class VoltageAdapter implements Voltage5V {

    private Voltage220V v; // 关联关系-聚合

    public VoltageAdapter(Voltage220V v) {
        this.v = v;
    }

    @Override
    public int output5V() {
        int dstv = 0;
        if (v != null) {
            int src = v.output220v();
            dstv = src / 44;
        }
        return dstv;
    }
}
